package com.mm.domain.book;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @Description 书籍网站表
 * @Date 2023/10/11 上午11:46
 * @Author yanglin
 **/
@Accessors(chain = true)
@TableName("d_book_source")
public class DBookSource {

    /**
     * 序号
     */
    @TableId(value = "source_id", type = IdType.AUTO)
    private Long sourceId;

    /**
     * 书籍网站标题
     */
    @TableField("source_title")
    private String sourceTitle;

    /**
     * 书籍网站源
     * 10-书趣阁 20-书本网 30-棉花糖 40-键盘小说
     */
    @TableField("source_web")
    private int sourceWeb;

    /**
     * 书籍网站源名称
     * 10-书趣阁 20-书本网 30-棉花糖 40-键盘小说
     */
    @TableField(exist = false)
    public String sourceWebName;

    /**
     * 书籍网站分类
     * 10-玄幻奇幻 20-武侠修真 30-现代都市 40-历史军事 50-游戏竞技 60-科幻灵异 70-女生言情 80-综漫同人 90-其他类型 100-最新
     */
    @TableField("source_category")
    private int sourceCategory;

    /**
     * 书籍网站分类
     * 10-玄幻奇幻 20-武侠修真 30-现代都市 40-历史军事 50-游戏竞技 60-科幻灵异 70-女生言情 80-综漫同人 90-其他类型 100-最新
     */
    @TableField(exist = false)
    private String sourceCategoryName;

    /**
     * 书籍网站地址
     */
    @TableField("source_url")
    private String sourceUrl;

    /**
     * 书籍网站爬取地址
     */
    @TableField("source_crawl_path")
    private String sourceCrawlPath;

    /**
     * 是否可用
     */
    @TableField("source_state")
    private boolean sourceState;

    /**
     * 下载类型(1-网址下载;2-解析章节下载)
     */
    @TableField("source_download_type")
    private int sourceDownloadType;

    /**
     * 最后更新时间
     */
    @TableField("last_update_time")
    private Date lastUpdateTime;

    public Long getSourceId() {
        return sourceId;
    }

    public void setSourceId(Long sourceId) {
        this.sourceId = sourceId;
    }

    public String getSourceTitle() {
        return sourceTitle;
    }

    public void setSourceTitle(String sourceTitle) {
        this.sourceTitle = sourceTitle;
    }

    public int getSourceWeb() {
        return sourceWeb;
    }

    public void setSourceWeb(int sourceWeb) {
        this.sourceWeb = sourceWeb;
    }

    public String getSourceWebName() {
        String sourceWebName = "";
        if (sourceWeb == 10) {
            sourceWebName = "书趣阁";
        } else if (sourceWeb == 20) {
            sourceWebName = "书本网";
        } else if (sourceWeb == 30) {
            sourceWebName = "棉花糖";
        } else if (sourceWeb == 40) {
            sourceWebName = "键盘网";
        } else if (sourceWeb == 50) {
            sourceWebName = "奇书网";
        }
        return sourceWebName;
    }

    public void setSourceWebName(String sourceWebName) {
        this.sourceWebName = sourceWebName;
    }

    public int getSourceCategory() {
        return sourceCategory;
    }

    public void setSourceCategory(int sourceCategory) {
        this.sourceCategory = sourceCategory;
    }

    public String getSourceCategoryName() {
        String sourceCategoryName = "";
        if (sourceCategory == 10) {
            sourceCategoryName = "玄幻奇幻";
        } else if (sourceCategory == 20) {
            sourceCategoryName = "武侠修真";
        } else if (sourceCategory == 30) {
            sourceCategoryName = "现代都市";
        } else if (sourceCategory == 40) {
            sourceCategoryName = "历史军事";
        } else if (sourceCategory == 50) {
            sourceCategoryName = "游戏竞技";
        } else if (sourceCategory == 60) {
            sourceCategoryName = "科幻灵异";
        } else if (sourceCategory == 70) {
            sourceCategoryName = "女生言情";
        } else if (sourceCategory == 80) {
            sourceCategoryName = "综漫同人";
        } else if (sourceCategory == 90) {
            sourceCategoryName = "其他类型";
        } else if (sourceCategory == 100) {
            sourceCategoryName = "最近更新";
        }
        return sourceCategoryName;
    }


    public void setSourceCategoryName(String sourceCategoryName) {
        this.sourceCategoryName = sourceCategoryName;
    }

    public String getSourceUrl() {
        return sourceUrl;
    }

    public void setSourceUrl(String sourceUrl) {
        this.sourceUrl = sourceUrl;
    }

    public String getSourceCrawlPath() {
        return sourceCrawlPath;
    }

    public void setSourceCrawlPath(String sourceCrawlPath) {
        this.sourceCrawlPath = sourceCrawlPath;
    }

    public boolean isSourceState() {
        return sourceState;
    }

    public void setSourceState(boolean sourceState) {
        this.sourceState = sourceState;
    }

    public int getSourceDownloadType() {
        return sourceDownloadType;
    }

    public void setSourceDownloadType(int sourceDownloadType) {
        this.sourceDownloadType = sourceDownloadType;
    }

    public Date getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(Date lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

}
